<template>
    <h1>登录</h1>
    
    <p>账号：<input type="text" v-model="account" placeholder="请输入你的账号"></p>
    <p>密码：<input type="password" v-model="password" placeholder="请输入你的密码"></p>
    <button @click="login">登录</button>
</template>
<script>
export default{
    data(){
        return{
            account:'',
            password:''
        }
        
    },
    methods:{
        login(){
        if(this.account==="admin"&&this.password==="12345"){
            alert("登陆成功")
            this.$router.push("/Index")
        }else{
            alert("账号或密码错误")
            this.password = ''
        }
    }
    
    }
}
    
</script>